package com.aaa;

import org.junit.jupiter.api.Test;

public class danyi {


    @Test
    public  void testVehicle(){
        Vehicle1 vehicle = new Vehicle1();
        vehicle.runLD("汽车");
        vehicle.runLD("电车");
        vehicle.runTK("飞机");
    }

}

class Vehicle {
    public void run(String gj) {
        System.out.println(gj + "在公路上运行。。。");
    }
}




class Vehicle1 {
    // 一个方法  负责一项职责
    public void runLD(String gj) {
        System.out.println(gj + "在公路上运行。。。");
    }

    public void runTK(String gj) {
        System.out.println(gj + "在空中运行。。。");
    }
}

